<?
	if (!defined('i-Teck_ADMIN')) die("Hacking attempt");

	switch($mod){
		case "edit":
		$result=mysql_query("SELECT * FROM shop_config where id=1");	
		while($r=mysql_fetch_array($result)){
		?>
<form id="form1" name="form1" method="post">
   		<article class="module width_full">
			<header><h3>Hướng Dẫn Mua Hàng</h3></header>
				<div class="module_content">				
				<fieldset>
				<center><textarea rows="12" name="intro1" id="intro1"><?=stripslashes($r['intro1']);?></textarea>
				<script language="javascript1.2">generate_wysiwyg('intro1');</script>
				</center>
				</fieldset>
				<input type="submit" name="cmd" id="cmd" value="Sửa" class="alt_btn">
				</div>
		</article><!-- end of styles article -->
</form>
  <? }?>
<?
if(isset($_POST["cmd"])=="Sửa"){  
		mysql_query("UPDATE shop_config SET  
					intro1='".addslashes($_POST['intro1'])."' WHERE id=1");
		mysql_close();
		echo "<meta http-equiv='refresh' content='0; url=?act=huongdanmua&mod=ok'>";
	}

	break; 
	case"ok":
		echo"<center>Đã sửa xong!</center>
		<script>setTimeout(\"window.location='?act=huongdanmua&mod=edit';\", 1000);</script></center>";
	break;
	

}?>
